package org.jing.core.lang.data.json;

/**
 * Description: json元素 <br>
 *
 * @author bks <br>
 * @since 2024-07-22 <br>
 */
public class Token {
    private TokenType type;

    private String value;

    Token(TokenType type, String value) {
        this.type = type;
        this.value = value;
    }

    /**
     * Description: 获取Json元素类型. <br>
     *
     * @return <br>
     */
    public TokenType getType() {
        return type;
    }

    /**
     * Description: 获取Json元素值(字符串). <br>
     *
     * @return <br>
     */
    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return String.format("<%s,%s>", type, value);
    }
}
